<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改学生</title>
    <style>
        table{
            border-collapse: collapse;
        }
        td:first-child{
            text-align: right;
        }
        tr:first-child{
            text-align: center;
        }
    </style>
</head>
<body>
<form action="" method="post">
    {% csrf_token %}
    <table border="1">
        <tr>
            <td>学生姓名：</td>
            <td><input type="text" name="name" value="{{ stu.1 }}"></td>
        </tr>
        <tr>
            <td>性别：</td>
            <td>
                {% if stu.2 == 1 %}
                    <input type="radio" name="sex" checked value="1">男
                    <input type="radio" name="sex"  value="0">女
                {% else %}
                    <input type="radio" name="sex"  value="1">男
                    <input type="radio" name="sex" checked value="0">女
                {% endif %}
            </td>
        </tr>
        <tr>
            <td>学生班级</td>
            <td>
                <select name="class_id" id="">
                    {% for i in class %}
                        {% if i.0 == stu.4 %}
                            <option selected value="{{ i.0 }}">{{ i.1 }}</option>
                        {% else %}
                            <option value="{{ i.0 }}">{{ i.1 }}</option>
                        {% endif %}
                    {% endfor %}
                </select>
            </td>
        </tr>
        <tr>
            <td>学生分数</td>
            <td><input type="text" name="score" value="{{ stu.3 }}"></td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="修改"></td>
        </tr>
    </table>
    <br>
</form>

</body>
</html>